﻿<?php
if(!defined('IN_PHPSCUP'))exit('hacking'); 

class JobApp extends BaseApp
{
    function index()
    {
		$GLOBALS['Lang']->_get_lang('job');	
		require(ROOT_PATH . '/lib/nav.lib.php');
	
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
        $this->assign('category_nav_data', $nav->curnav());			

        $this->assign('navigation', $nav->_get_nav());	
        $pic_data = @include(ROOT_PATH . '/data/cache/rollpic_'.trim($GLOBALS['Lang']->_lang_tp).'.php'); 
		$this->assign('pic_data', $pic_data);	
		
		$TB_job = &$this->_model('job'); 
				
		$data = $TB_job->show();	
	 	$categorydata = & $GLOBALS['SCup']->_get_category_data('prot');
		
        $this->assign('categorydata', $categorydata);		    
	        $qq_data = array();
        $qq_temp1 = del_empty_var(explode('|', QQ_SET_DATA));
		foreach($qq_temp1 as $key=>$value)
		{
           $qq_temp2 = del_empty_var(explode(':', $value));	
		   $qq_data[$qq_temp2[0]] = $qq_temp2[1];     
		}
        $this->assign('qq_data',$qq_data);	
		
		
		$TB_new = &$this->_model('new');				
		$data_index_new = $TB_new->reindex();		
        $this->assign('data_index_new', $data_index_new);		
		
		$TB_prot = &$this->_model('prot');				
		$data_index_prot = $TB_prot->reindex();		
        $this->assign('data_index_prot', $data_index_prot);		
		
        $this->assign('lw_data', $data['data']);		
		$this->assign('lw_page', $data['page']); 	
        $this->assign('langdata', $GLOBALS['Lang']->_get_lang_typesdata());	 	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);		
        $this->assign('langtype', trim($GLOBALS['Lang']->_lang_tp));
        $this->assign('site_url',SITE_URL);
		$this->assign('bg_pic_url',SITE_URL.'/'.$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');	
			
        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);		
		
        $this->display('job.view.html');
    }
	
    function show()
    {
		
		$id= intval($_GET['id']);
		$GLOBALS['Lang']->_get_lang('job');	
		require(ROOT_PATH . '/lib/nav.lib.php');
		
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
        $this->assign('category_nav_data', $nav->curnav());		
        $this->assign('navigation', $nav->_get_nav());	
        $pic_data = @include(ROOT_PATH . '/data/cache/rollpic_'.trim($GLOBALS['Lang']->_lang_tp).'.php');  
		$this->assign('pic_data', $pic_data);	
		
		$TB_job = &$this->_model('job'); 
				
		$data = $TB_job->oneshow($id);	

	 	$categorydata = & $GLOBALS['SCup']->_get_category_data('prot');
		
        $this->assign('categorydata', $categorydata);	
			
$PHP_SELF_TEMP=$_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$_SERVER['QUERY_STRING'] && $PHP_SELF_TEMP .= "?".$_SERVER['QUERY_STRING'];
$PHP_SELF=$_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:$PHP_SELF_TEMP;
$HTTP_HOST=$_SERVER['HTTP_HOST']?$_SERVER['HTTP_HOST']:$HTTP_SERVER_VARS['HTTP_HOST'];
$WEBURL='http://'.$HTTP_HOST.$PHP_SELF;

        $this->assign('request_url', $WEBURL);
	        $qq_data = array();
        $qq_temp1 = del_empty_var(explode('|', QQ_SET_DATA));
		foreach($qq_temp1 as $key=>$value)
		{
           $qq_temp2 = del_empty_var(explode(':', $value));	
		   $qq_data[$qq_temp2[0]] = $qq_temp2[1];     
		}
        $this->assign('qq_data',$qq_data);	
		
		
		$TB_new = &$this->_model('new');				
		$data_index_new = $TB_new->reindex();		
        $this->assign('data_index_new', $data_index_new);		
		
		$TB_prot = &$this->_model('prot');				
		$data_index_prot = $TB_prot->reindex();		
        $this->assign('data_index_prot', $data_index_prot);				
        $this->assign('data', $data);	
        $this->assign('langdata', $GLOBALS['Lang']->_get_lang_typesdata());	 	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $data['jobname'].'-'.SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);	
        $this->assign('langtype', trim($GLOBALS['Lang']->_lang_tp));
	        $this->assign('site_url',SITE_URL);	
		$this->assign('bg_pic_url',SITE_URL.'/'.$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');	

        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);		
		
        $this->display('jobshow.view.html');
    }
    
    function jobhui(){ 	
		$id= intval($_GET['id']);
		$GLOBALS['Lang']->_get_lang('job');	
		require(ROOT_PATH . '/lib/nav.lib.php');
		
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
        $this->assign('category_nav_data', $nav->curnav());		
        $this->assign('navigation', $nav->_get_nav());	
        $pic_data = @include(ROOT_PATH . '/data/cache/rollpic_'.trim($GLOBALS['Lang']->_lang_tp).'.php');  
		$this->assign('pic_data', $pic_data);	
		
		$TB_job = &$this->_model('job'); 
				
		$data = $TB_job->oneshow($id);	

	 	$categorydata = & $GLOBALS['SCup']->_get_category_data('prot');
		
        $this->assign('categorydata', $categorydata);	
			
$PHP_SELF_TEMP=$_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$_SERVER['QUERY_STRING'] && $PHP_SELF_TEMP .= "?".$_SERVER['QUERY_STRING'];
$PHP_SELF=$_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:$PHP_SELF_TEMP;
$HTTP_HOST=$_SERVER['HTTP_HOST']?$_SERVER['HTTP_HOST']:$HTTP_SERVER_VARS['HTTP_HOST'];
$WEBURL='http://'.$HTTP_HOST.$PHP_SELF;

        $this->assign('request_url', $WEBURL);
	        $qq_data = array();
        $qq_temp1 = del_empty_var(explode('|', QQ_SET_DATA));
		foreach($qq_temp1 as $key=>$value)
		{
           $qq_temp2 = del_empty_var(explode(':', $value));	
		   $qq_data[$qq_temp2[0]] = $qq_temp2[1];     
		}
        $this->assign('qq_data',$qq_data);	
		
		
		$TB_new = &$this->_model('new');				
		$data_index_new = $TB_new->reindex();		
        $this->assign('data_index_new', $data_index_new);		
		
		$TB_prot = &$this->_model('prot');				
		$data_index_prot = $TB_prot->reindex();		
        $this->assign('data_index_prot', $data_index_prot);				
        $this->assign('data', $data);	
        $this->assign('langdata', $GLOBALS['Lang']->_get_lang_typesdata());	 	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $data['jobname'].'-'.SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);	
        $this->assign('langtype', trim($GLOBALS['Lang']->_lang_tp));
	        $this->assign('site_url',SITE_URL);	
		$this->assign('bg_pic_url',SITE_URL.'/'.$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');	

        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);	

	
    	$this->display('jobhui.view.html');
    }
    
    function jobhuido(){
 
		 unset($data['photo']);
		if($_FILES['postfile1']['tmp_name'])
	    { 			 
	     include(ROOT_PATH.'/lib/upfile.lib.php');	  
	     $upfile = new Upfile('job'); 	  
	     $updata = $upfile->_batch_upfile('job');		 
		 if(!isset($updata[1]['path']))	
		 {
		 $updata[1]['path'] ='';
		 }			 		 
		 $data['photo'] = $updata[1]['path'];		 
	 	}	
		if(!isset($data['photo']))$data['photo']='';	 

 $data['job_id'] = $_POST['jobid'];
    	$data['name'] = $_POST['name'];
    	$data['yingpinzhiwei'] = $_POST['yingpinzhiwei'];
    	$data['tianbiaoshijian'] = $_POST['tianbiaoshijian'];
    	$data['yingzhengren'] = $_POST['yingzhengren'];
    	$data['yingzhengshijian'] = $_POST['yingzhengshijian'];
    	$data['sex'] = $_POST['sex'];
    	$data['minzu'] = $_POST['minzu'];
    	$data['wenhua'] = $_POST['wenhua'];
    	$data['jiguang'] = $_POST['jiguang'];
    	$data['shengao'] = $_POST['shengao'];
    	$data['shengri'] = $_POST['shengri'];
    	$data['hunyin'] = $_POST['hunyin'];
    	$data['tizhong'] = $_POST['tizhong'];
    	$data['zzmm'] = $_POST['zzmm'];
    	$data['jiankang'] = $_POST['jiankang'];
    	$data['shebao'] = $_POST['shebao'];
    	$data['sfzh'] = $_POST['sfzh'];
    	$data['email'] = $_POST['email'];
    	$data['hukou'] = $_POST['hukou'];
    	$data['hkyoubian'] = $_POST['hkyoubian'];
    	$data['gddh'] = $_POST['gddh'];
    	$data['zhuzhi'] = $_POST['zhuzhi'];
    	$data['zzyoubian'] = $_POST['zzyoubian'];
    	$data['shouji'] = $_POST['shouji'];
    	
    	$xueli_start = $_POST['xueli_start'];
    	$xueli_school = $_POST['xueli_school'];
    	$xueli_zhuanye = $_POST['xueli_zhuanye'];
    	$xueli_yuzhong = $_POST['xueli_yuzhong'];
    	
    	$data['xueli'] = '';
    	foreach($xueli_start as $k=>$xl){
    		$biye = 'xueli_biye'.($k+1);
    		$data['xueli'] .= $xl.','.$xueli_school[$k].','.$xueli_zhuanye[$k].','.$xueli_yuzhong[$k].','.$_POST[$biye].'|';
    	}
    	$data['xueli'] = substr($data['xueli'], 0,-1);
    	
    	$gongzuojingli_start = $_POST['gongzuojingli_start'];
    	$gongzuojingli_danwei = $_POST['gongzuojingli_danwei'];
    	$gongzuojingli_neirong = $_POST['gongzuojingli_neirong'];
    	$gongzuojingli_zhiwu = $_POST['gongzuojingli_zhiwu'];
    	$gongzuojingli_yuexin = $_POST['gongzuojingli_yuexin'];
    	$gongzuojingli_lizhi = $_POST['gongzuojingli_lizhi'];
    	$data['gongzuojingli'] = '';
    	foreach($gongzuojingli_start as $k=>$xl){
    		$data['gongzuojingli'] .= $xl.','.$gongzuojingli_danwei[$k].','.$gongzuojingli_neirong[$k].','.$gongzuojingli_zhiwu[$k].','.$gongzuojingli_yuexin[$k].','.$gongzuojingli_lizhi[$k].'|';
    	}
    	$data['gongzuojingli'] = substr($data['gongzuojingli'], 0,-1);
    	
    	$data['chengyuan_peiou'] = $_POST['chengyuan_peiou_name'].','.$_POST['chengyuan_peiou_gx'].','.$_POST['chengyuan_peiou_nl'].','.$_POST['chengyuan_peiou_nl'].','.$_POST['chengyuan_peiou_dw'].','.$_POST['chengyuan_peiou_zw'].','.$_POST['chengyuan_peiou_dh'];
    	$data['chengyuan_zn'] = '';
    	$chengyuan_zn_name = $_POST['chengyuan_zn_name'];
    	$chengyuan_zn_gx = $_POST['chengyuan_zn_gx'];
    	$chengyuan_zn_nl = $_POST['chengyuan_zn_nl'];
    	$chengyuan_zn_dw = $_POST['chengyuan_zn_dw'];
    	$chengyuan_zn_zw = $_POST['chengyuan_zn_zw'];
    	$chengyuan_zn_dh = $_POST['chengyuan_zn_dh'];
    	foreach($chengyuan_zn_name as $k=>$zn){
    		$data['chengyuan_zn'] .= $zn.','.$chengyuan_zn_gx[$k].','.$chengyuan_zn_nl[$k].','.$chengyuan_zn_dw[$k].','.$chengyuan_zn_zw[$k].','.$chengyuan_zn_dh[$k].'|';
    	}
    	$data['chengyuan_zn'] = substr($data['chengyuan_zn'], 0,-1);
    	
    	$data['chengyuan_fm'] = '';
    	$chengyuan_fm_name = $_POST['chengyuan_fm_name'];
    	$chengyuan_fm_gx = $_POST['chengyuan_fm_gx'];
    	$chengyuan_fm_nl = $_POST['chengyuan_fm_nl'];
    	$chengyuan_fm_dw = $_POST['chengyuan_fm_dw'];
    	$chengyuan_fm_zw = $_POST['chengyuan_fm_zw'];
    	$chengyuan_fm_dh = $_POST['chengyuan_fm_dh'];
    	foreach($chengyuan_fm_name as $k=>$fm){
    		$data['chengyuan_fm'] .= $fm.','.$chengyuan_fm_gx[$k].','.$chengyuan_fm_nl[$k].','.$chengyuan_fm_dw[$k].','.$chengyuan_fm_zw[$k].','.$chengyuan_fm_dh[$k].'|';
    	}
    	$data['chengyuan_fm'] = substr($data['chengyuan_fm'], 0,-1);
    	
    	$data['chengyuan_pfm'] = '';
    	$chengyuan_pfm_name = $_POST['chengyuan_pfm_name'];
    	$chengyuan_pfm_gx = $_POST['chengyuan_pfm_gx'];
    	$chengyuan_pfm_nl = $_POST['chengyuan_pfm_nl'];
    	$chengyuan_pfm_dw = $_POST['chengyuan_pfm_dw'];
    	$chengyuan_pfm_zw = $_POST['chengyuan_pfm_zw'];
    	$chengyuan_pfm_dh = $_POST['chengyuan_pfm_dh'];
    	foreach($chengyuan_pfm_name as $k=>$pfm){
    		$data['chengyuan_pfm'] .= $pfm.','.$chengyuan_pfm_gx[$k].','.$chengyuan_pfm_nl[$k].','.$chengyuan_pfm_dw[$k].','.$chengyuan_pfm_zw[$k].','.$chengyuan_pfm_dh[$k].'|';
    	}
    	$data['chengyuan_pfm'] = substr($data['chengyuan_pfm'], 0,-1);
    	
    	$data['chengyuan_xdjm'] = '';
    	$chengyuan_xdjm_name = $_POST['chengyuan_xdjm_name'];
    	$chengyuan_xdjm_gx = $_POST['chengyuan_xdjm_gx'];
    	$chengyuan_xdjm_nl = $_POST['chengyuan_xdjm_nl'];
    	$chengyuan_xdjm_dw = $_POST['chengyuan_xdjm_dw'];
    	$chengyuan_xdjm_zw = $_POST['chengyuan_xdjm_zw'];
    	$chengyuan_xdjm_dh = $_POST['chengyuan_xdjm_dh'];
    	foreach($chengyuan_xdjm_name as $k=>$xdjm){
    		$data['chengyuan_xdjm'] .= $xdjm.','.$chengyuan_xdjm_gx[$k].','.$chengyuan_xdjm_nl[$k].','.$chengyuan_xdjm_dw[$k].','.$chengyuan_xdjm_zw[$k].','.$chengyuan_xdjm_dh[$k].'|';
    	}
    	$data['chengyuan_xdjm'] = substr($data['chengyuan_xdjm'], 0,-1);
    	
    	$data['chengyuan_qq'] = '';
    	$chengyuan_qq_name = $_POST['chengyuan_qq_name'];
    	$chengyuan_qq_gx = $_POST['chengyuan_qq_gx'];
    	$chengyuan_qq_nl = $_POST['chengyuan_qq_nl'];
    	$chengyuan_qq_dw = $_POST['chengyuan_qq_dw'];
    	$chengyuan_qq_zw = $_POST['chengyuan_qq_zw'];
    	$chengyuan_qq_dh = $_POST['chengyuan_qq_dh'];
    	foreach($chengyuan_qq_name as $k=>$qq){
    		$data['chengyuan_qq'] .= $qq.','.$chengyuan_qq_gx[$k].','.$chengyuan_qq_nl[$k].','.$chengyuan_qq_dw[$k].','.$chengyuan_qq_zw[$k].','.$chengyuan_qq_dh[$k].'|';
    	}
    	$data['chengyuan_qq'] = substr($data['chengyuan_qq'], 0,-1);
    	
    	$data['aihao'] = $_POST['aihao'];
    	$data['jiangli_xunlian'] = $_POST['jiangli_xunlian'];
    	$data['weilai'] = $_POST['weilai'];
    	$data['ischuchai'] = $_POST['ischuchai'];
    	$data['chuchaididiang'] = $_POST['chuchaididiang'];
    	$data['isjiaban'] = $_POST['isjiaban'];
    	$data['xw_xinzi'] = $_POST['xw_xinzi'];
    	$data['isqinyou'] = $_POST['isqinyou'];
    	
    	$qinyou_info_name = $_POST['qinyou_info_name'];
    	$qinyou_info_gx = $_POST['qinyou_info_gx'];
    	$data['qinyou_info'] = ''; 
    	foreach($qinyou_info_name as $k=>$v){
    		$data['qinyou_info'] .= $v.','.$qinyou_info_gx[$k].'|';
    	}
    	$data['qinyou_info'] = substr($data['qinyou_info'], 0,-1);
    	
    	$pengyou_info_name = $_POST['pengyou_info_name'];
    	$pengyou_info_dh = $_POST['pengyou_info_dh'];
    	$data['pengyou_info'] = ''; 
    	foreach($pengyou_info_name as $k=>$v){
    		$data['pengyou_info'] .= $v.','.$pengyou_info_dh[$k].'|';
    	}
    	$data['pengyou_info'] = substr($data['pengyou_info'], 0,-1);
    	
    	$data['lately_e_name'] = $_POST['lately_e_name'];
    	$data['lately_e_danwei'] = $_POST['lately_e_danwei'];
    	$data['lately_e_zhiwu'] = $_POST['lately_e_zhiwu'];
    	$data['lately_e_dizhi'] = $_POST['lately_e_dizhi'];
    	$data['lately_e_youbian'] = $_POST['lately_e_youbian'];
    	$data['lately_e_dianhua'] = $_POST['lately_e_dianhua'];
    	$data['lately_e_guanxi'] = $_POST['lately_e_guanxi'];
    	
    	$qidao_type = $_POST['qidao_type'];
    	$qidao_name = $_POST['qidao_name'];
    	$data['qidao'] = ''; 
    	foreach((array)$qidao_type as $k=>$v){
    		$data['qidao'] .= $v.','.$qidao_name[$k].'|';
    	}
    	$data['qidao'] .= $_POST['qidao_jieshao'].','.$_POST['qidao_jieshao_name'].','.$_POST['qidao_jieshao_gx'].'|'.$_POST['qidao_qita'].','.$_POST['qidao_qita_text'];
    	$data['add_time'] = time();
    	
    	$data['user_id'] = $GLOBALS['SCup']->SCup_user_msg['user_id'];

		 $TB_job = &$this->_model('job');
		 
		 if($TB_job->addhrsubmit($data)){		 
		    $notice = &get_message(array('msg'=>'Scucess!','url'=>'?app=job&act=show&id='.$data['job_id'],'title'=>'Notice'));
		    $notice ->display();
		}else{
		    $notice = &get_message(array('msg'=>'False!','url'=>'','title'=>'Notice'));
		    $notice ->display();
		}

    }
    
    function view(){

    	$id= intval($_GET['id']);
		$GLOBALS['Lang']->_get_lang('job');	
		require(ROOT_PATH . '/lib/nav.lib.php');
		
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
		
        $this->assign('navigation', $nav->_get_nav());	
        $pic_data = @include(ROOT_PATH . '/data/cache/rollpic_'.trim($GLOBALS['Lang']->_lang_tp).'.php');  
		$this->assign('pic_data', $pic_data);	
		
		$TB_job = &$this->_model('job'); 
		
		$data = $TB_job->getHrSubmitById($id);	
		
		$data['chengyuan_peiou'] = explode(',',$data['chengyuan_peiou']);
		
		$xueliArr = explode('|',$data['xueli']);
		$xueli = array();
		foreach($xueliArr as $v){
			$xueli[] = explode(',',$v);
		}
		
		$data['xueli'] = $xueli;
		
		$gongzuojingliArr = explode('|',$data['gongzuojingli']);
		$gongzuojingli = array();
		foreach($gongzuojingliArr as $v){
			$gongzuojingli[] = explode(',',$v);
		}
		$data['gongzuojingli'] = $gongzuojingli;
		
		$chengyuan_znArr = explode('|',$data['chengyuan_zn']);
		$chengyuan_zn = array();
		foreach($chengyuan_znArr as $v){
			$chengyuan_zn[] = explode(',',$v);
		}
		$data['chengyuan_zn'] = $chengyuan_zn;
		
		$chengyuan_fmArr = explode('|',$data['chengyuan_fm']);
		$chengyuan_fm = array();
		foreach($chengyuan_fmArr as $v){
			$chengyuan_fm[] = explode(',',$v);
		}
		$data['chengyuan_fm'] = $chengyuan_fm;
		
		$chengyuan_pfmArr = explode('|',$data['chengyuan_pfm']);
		$chengyuan_pfm = array();
		foreach($chengyuan_pfmArr as $v){
			$chengyuan_pfm[] = explode(',',$v);
		}
		$data['chengyuan_pfm'] = $chengyuan_pfm;
		
		$chengyuan_xdjmArr = explode('|',$data['chengyuan_xdjm']);
		$chengyuan_xdjm = array();
		foreach($chengyuan_xdjmArr as $v){
			$chengyuan_xdjm[] = explode(',',$v);
		}
		$data['chengyuan_xdjm'] = $chengyuan_xdjm;
		
		$chengyuan_qqArr = explode('|',$data['chengyuan_qq']);
		$chengyuan_qq = array();
		foreach($chengyuan_qqArr as $v){
			$chengyuan_qq[] = explode(',',$v);
		}
		$data['chengyuan_qq'] = $chengyuan_qq;
		
		$qinyou_infoArr = explode('|',$data['qinyou_info']);
		$qinyou_info = array();
		foreach($qinyou_infoArr as $v){
			$qinyou_info[] = explode(',',$v);
		}
		$data['qinyou_info'] = $qinyou_info;
		
		$pengyou_infoArr = explode('|',$data['pengyou_info']);
		$pengyou_info = array();
		foreach($pengyou_infoArr as $v){
			$pengyou_info[] = explode(',',$v);
		}
		$data['pengyou_info'] = $pengyou_info;
		
		$qidaoArr = explode('|',$data['qidao']);
		$qidao = array();
		foreach($qidaoArr as $v){
			$qidao[] = explode(',',$v);
		}
		$data['qidao'] = $qidao;
		
		$this->assign('data',$data);	
    	
    	$this->display('view_submit.view.html');
    }

}

?>